[libvirt_manager] Add predictable network interface names to EDPM#3891
[libvirt_manager] Add predictable network interface names to EDPM#3891holser wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
LGTM, asked for a TP. |
| {{ | ||
| (vm_item | default(_clean_vm)) | replace('-', '') | ||
| }} | ||
| _target_dev: >- |
There was a problem hiding this comment.
(praise) Great improvement adding --target for predictable NIC naming.
(Question) : _target_dev is currently computed as (_vm_short ~ 'p' ~ (net_idx|int))[:15]. Because this relies on truncation to satisfy the 15‑char limit, there’s a chance of collisions for VMs with similar prefixes. Just another thing to mention, once net_idx goes to 2+ digits (p9 → p10), the suffix length changes and the truncation point shifts, which increases the chance of two different inputs collapsing to the same 15‑char string.
Would you be up for considering a slightly more collision‑resistant naming scheme that still stays within 15 characters (for example a fixed layout like <vm_prefix><short_hash_of _clean_vm>, using only letters and numbers)? Alternatively, a small guard/assert to catch duplicate targets early could also work nicely.
There was a problem hiding this comment.
I have removed this part as it requires unique naming for all interfaces. PR update relies on virt-customize only and VM OS ability to set up networking interfaces based on pci lanes
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 19m 14s |
Enable systemd predictable network interface naming inside guest VMs by removing net.ifnames=0 from kernel args via virt-customize. This gives guests consistent PCI-topology-based names (enp1s0, enp2s0, etc.) instead of legacy ethN naming. Predictable network interfaces are requirement for testing Leapp upgrade functionality. Controlled by cifmw_libvirt_manager_predictable_nic_names (defaults to false). Jira: OSPRH-29381 Co-Authored-By: Lukas Bezdicka <lbezdick@redhat.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Sergii Golovatiuk <sgolovat@redhat.com>
|
/lgtm |
|
Changes lgtm, especially seeing that they are opt-in, but @holser do you have a testproject that uses these changes that you could link in the comments of that jira story? I see Enrique requested one here and in the jira comments. |
Enable systemd predictable network interface naming inside guest VMs
by removing
net.ifnames=0from kernel args via virt-customize. Thisgives guests consistent PCI-topology-based names (enp1s0, enp2s0, etc.)
instead of legacy ethN naming. Predictable network interfaces are
requirement for testing Leapp upgrade functionality.
Controlled by cifmw_libvirt_manager_predictable_nic_names (defaults
to false).
Jira: OSPRH-29381